///////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) 2007-2009 ILOG, S.A.
//  All Rights Reserved.
//  The following is ILOG Source Code.  No modifications may be made to the  
//  ILOG Source Code.  Any usage of the ILOG Source Code is subject to 
//  the terms and conditions of the ILOG End User License Agreement   
//  applicable to this ILOG software product.
//
///////////////////////////////////////////////////////////////////////////////

package ilog.gauges.gaugesClasses
{
  import flash.events.IEventDispatcher;

  /**
   * The <code>IScale</code> interface is an abstract interface to define scales
   * for both circular and rectangular gauges.
   *  
   * @see ilog.gauges.gaugesClasses.circular.ICircularScale
   * @see ilog.gauges.gaugesClasses.rectangular.IRectangularScale
   * 
   */
  public interface IScale extends IEventDispatcher
  {
    /**
     * An array of <code>TickItem</code> instances that represents the major ticks of the scale.
     * When automatically computed, this array must be rebuilt after calls to the
     * <code>invalidateTicks()</code> method.
     */
    function get majorTickItems():Array;

    /**
     * An array of <code>TickItem</code> instances that represents the minor ticks of the scale.
     * When automatically computed this array must be rebuilt after calls to the
     * <code>invalidateTicks()</code> method.
     */
    function get minorTickItems():Array;

    /**
     * Registers a <code>GaugeElement</code> on this scale.
     * Each <code>GaugeElement</code> that makes use of a scale
     * registers itself with this scale using this method.
     * The scale is responsible for notifying the visual elements
     * when their relevant values have changed, by invalidating the visual
     * elements.
     *
     * @param element The <code>GaugeElement</code> to register.
     */
    function registerElement(element:GaugeElement):void;

    /**
     * Unregisters a <code>GaugeElement</code> from this scale.
     * Each <code>GaugeElement</code> that makes use of a scale
     * registers itself with this scale using this method.
     * The scale is responsible for notifying the visual elements
     * when their relevant values have changed, by invalidating the visual
     * elements.
     *
     * @param element The <code>GaugeElement</code> to register.
     */
    function unregisterElement(element:GaugeElement):void;
    
    /**
     * Invalidates a scale so that its visual elements are refreshed 
     * during a later screen update.
     */    
    function invalidateElements():void;
    
    /**
     * Invalidates a scale so that its major and minor ticks are regenerated
     * during a later screen update.
     */    
    function invalidateTicks():void;
  }
}
